Loop_Practise_Que_07

Home / Java Practice Question / Loop_Practise_Que_07

Loop_Practise_Que_07


WAP to count digits in an given Number...

Program : -


public class Loop{
   public static int countDigit(int num)
 {
     int count=0;
for(int i=num;i>0;i=i/10){
count++;
}

return count;
}
}